package com.aspose.cells;

public class ChartDataTable {
   private Chart a;
   private Font b;
   private int c = -1;
   private boolean d = true;
   private int e = 0;
   private boolean f = true;
   private boolean g = true;
   private boolean h = true;
   private boolean i = true;
   private Line j;
   private ShapePropertyCollection k;

   ChartDataTable(Chart chart) {
      this.a = chart;
   }

   void a(ChartDataTable var1, CopyOptions var2) {
      this.d = var1.d;
      this.c = -1;
      this.e = var1.e;
      if (var1.b == null && var1.c == -1) {
         this.b = null;
      } else {
         this.b = new Font(this.a.j(), (Object)null, true);
         this.b.c(var1.getFont());
         if (var1.getFont().c() != null && var1.d) {
            zbi var3 = (zbi)var1.getFont().c();
            zbi var4 = new zbi(this.a, 0, false);
            var4.a(var3);
            this.b.a((Object)var4);
         }
      }

      this.f = var1.f;
      this.h = var1.h;
      this.g = var1.g;
      this.i = var1.i;
      if (var1.j != null) {
         this.j = new Line(this.a, this);
         this.j.a(var1.j);
      } else {
         this.j = null;
      }

      if (var1.k != null) {
         this.k = new ShapePropertyCollection(this.a, this, 3);
         this.k.a(var1.k, var2);
      }

   }

   public Font getFont() {
      if (this.b == null) {
         this.b = new Font(this.a.j(), (Object)null, true);
         this.b.setSize(10);
         if (this.c != -1) {
            Font var1 = (Font)this.a.j().z().get(this.c > 4 ? this.c - 1 : this.c);
            this.b.c(var1);
            this.b.b.b(true);
            zbi var2 = this.a.c(this.c);
            if (var2 != null) {
               zbi var3 = new zbi(var2.f, 0, false);
               var3.a(var2);
               this.b.a((Object)var3);
            }
         } else if (this.getAutoScaleFont()) {
            this.b.a((Object)(new zbi(this.a, this.b.getSize(), true)));
         }
      }

      return this.b;
   }

   Font a() {
      return this.b == null && this.c != -1 ? this.a.j().j(this.c) : this.b;
   }

   int b() {
      return this.c;
   }

   void a(int var1) {
      this.c = var1;
   }

   void a(boolean var1) {
      this.d = var1;
   }

   public boolean getAutoScaleFont() {
      return this.d;
   }

   public void setAutoScaleFont(boolean value) {
      if (value) {
         if (this.b != null) {
            zbi var2 = new zbi(this.a, this.b.getSize(), true);
            this.b.a((Object)var2);
         }
      } else {
         this.getFont().a((Object)null);
      }

      this.d = value;
   }

   public int getBackgroundMode() {
      return this.e;
   }

   public void setBackgroundMode(int value) {
      this.e = value;
   }

   /** @deprecated */
   public int getBackground() {
      return this.e;
   }

   /** @deprecated */
   public void setBackground(int value) {
      this.e = value;
   }

   public boolean hasBorderHorizontal() {
      return this.f;
   }

   public void setHasBorderHorizontal(boolean value) {
      this.f = value;
   }

   public boolean hasBorderVertical() {
      return this.g;
   }

   public void setHasBorderVertical(boolean value) {
      this.g = value;
   }

   public boolean hasBorderOutline() {
      return this.h;
   }

   public void setHasBorderOutline(boolean value) {
      this.h = value;
   }

   public boolean getShowLegendKey() {
      return this.i;
   }

   public void setShowLegendKey(boolean value) {
      this.i = value;
   }

   public Line getBorder() {
      if (this.j == null) {
         this.j = new Line(this.a, this);
      }

      return this.j;
   }

   Line c() {
      return this.j;
   }

   ShapePropertyCollection d() {
      if (this.k == null) {
         this.k = new ShapePropertyCollection(this.a, this, 3);
      }

      return this.k;
   }
}
